package com.intelligent.ispc.core.service;

import com.intelligent.ispc.core.dto.ResourceDto;
import com.intelligent.ispc.core.dto.RoleDto;

import java.util.List;
import java.util.Map;

/**
 * Created by Rovey.Luo on 2015/11/25.
 */
public interface PermissionService {
    void savePermission(ResourceDto resourceDto);

    void updatePermission(ResourceDto resourceDto);

    void deletePermission(String uuid);

    ResourceDto findByUuid(String uuid);

    ResourceDto findByLoginName(String name);

    List<ResourceDto> findAllResources();

    Map<String, List<ResourceDto>> findAllResourcesWithCategory();

    List<RoleDto> resourceCanAddRole(String id);

    void assignRolesForPermission(String resourceId, List<String> roleIds);

    List<RoleDto> searchRoles(List<String> roleIds);

    void deleteRoleForPermission(String permissionId, String roleId);
}
